/*
 * @Author: WangShuai 1830773767@qq.com
 * @Date: 2025-06-19 23:11:50
 * @LastEditors: WangShuai 1830773767@qq.com
 * @LastEditTime: 2025-06-20 18:40:13
 * @FilePath: \shangyitong\vite.config.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vite.dev/config/
//引入node提供的内置模块path，可以获取绝对路径
import path from 'path'

export default defineConfig({
    plugins: [vue()],
    resolve: {
        alias: {
            '@': path.resolve(__dirname, 'src')
        }
    },
    server: {
        proxy: {
            '/api': {
                target: 'http://syt.atguigu.cn',
                changeOrigin: true,
                // rewrite: (path) => path.replace(/^\/api/, ''),
            },
        }
    }
})
